package com.gitee.xmhzzz.gateway.quick.start.route;

import org.springframework.cloud.gateway.route.RouteLocator;
import org.springframework.cloud.gateway.route.builder.RouteLocatorBuilder;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @ClassName GatewayConfig
 * @Description
 * @Author wzq
 * @Date 2023/12/28 11:31
 * @Version 1.0
 */
@Configuration
public class GatewayConfig {
    @Bean
    public RouteLocator customRouteLocator(RouteLocatorBuilder routeLocatorBuilder){
        RouteLocatorBuilder.Builder routes =routeLocatorBuilder.routes();
        routes.route("demo-service1",r -> r.path("/demo-server/demo/test/gateway/bean").uri("http://127.0.0.1:8003/demo-service/demo/test/gateway/bean"));
        return routes.build();
    }
}

